﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="Web.home.login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" href="/template/default/style/style.css"/>
    <script src="/js/jquery-1.10.2.js"></script>
    <script>
        function checkname() {
            var pass = document.getElementById('tbName').value;
            if (pass.length < 5) {
                document.getElementById('tbName').style.boxShadow = '0 0 0 2px red';
                return false
            }
            else {
                document.getElementById('tbName').style.boxShadow = '0 0 0 2px #00aec7';
                return true;
            }
        }
        function checkpasswd() {
            var pass = document.getElementById('tbPasswd').value;
            if (pass.length < 5) {
                document.getElementById('tbPasswd').style.boxShadow = '0 0 0 2px red';
                return false;
            }
            else {
                document.getElementById('tbPasswd').style.boxShadow = '0 0 0 2px #00aec7';
                return true;
            }
        }
        $(document).ready(function () {
            $('#btnLogin').bind('click', function (e) {
                e.preventDefault();
                if (!checkname()) {
                    document.getElementById('tbName').style.boxShadow = '0 0 0 2px red';
                }
                else
                    document.getElementById('tbName').style.boxShadow = '0 0 0 2px #00aec7';

                if (!checkpasswd()) {
                    document.getElementById('tbPasswd').style.boxShadow = '0 0 0 2px red';
                    return;
                }
                else { document.getElementById('tbPasswd').style.boxShadow = '0 0 0 2px #00aec7'; }
            });
        });
    </script>
</head>
<body>
    <form id="login" runat="server">
    <div class="login-main">
        <div class="item"><label>用户名：</label><input id="tbName" runat="server" onblur="checkname()"  class="tb" type="text" /></div>
        <div class="item"><label>密&nbsp; &nbsp;码：</label><input id="tbPasswd" onblur="checkpasswd()" class="tb" type="password" runat="server" /></div>
        <div class="item">
            <input class="check" id="cbSave" type="checkbox" /><label>30天免登陆</label>
            <asp:Button Text="登陆" runat="server" OnClick="btnLogin_ServerClick" ID="btnLogin" />
                        <%--<input id="Submit1" class="btn" type="submit" onserverclick="btnLogin_ServerClick" runat="server" value="登陆" /></div>--%>

    </div>
    </form>
</body>
</html>
